import { createRouter, createWebHistory } from 'vue-router';
import Login from '../components/login/index.vue'
import Register from '../components/register/index.vue'
import Friends from '../components/home/friends.vue'
import Home from '../components/home/index.vue'
import User from '../components/home/user.vue'
import More from '../components/home/more.vue'
import SimilarUsers from "../components/more/similarUsers.vue";
import SearchUsers from "../components/more/searchUsers.vue";
import ShowSearchUserList from "../components/more/showSearchUserList.vue";
import MyTeam from "../components/more/myTeam.vue";
import TeamJoined from "../components/more/teamJoined.vue";
import CreateTeam from "../components/more/createTeam.vue";
import JoinTeam from "../components/more/joinTeam.vue";

const routes = [
    {
        path: '/',
        redirect: '/login'
    },
    {
        path: '/login',
        name: 'Login',
        component: Login,
        meta: {
            showNavBar: false, // 登录页不显示导航栏
            showTabBar: false, // 登录页不显示底部栏
        }
    },
    {
        path: '/register',
        name: 'Register',
        component: Register,
        meta: {
            showNavBar: false, // 不显示导航栏
            showTabBar: false, // 不显示底部栏
        }
    },
    {
        path: '/home',
        name: 'Home',
        component: Home,
        meta: {
            showNavBar: true,
            showTabBar: true,
        },
        children: [
            {
                path: 'friends',
                name: 'Friends',
                component: Friends
            },
            {
                path: 'user',
                name: 'User',
                component: User
            },
            {
                path: 'more',
                name: 'More',
                component: More
            }
        ]
    },
    {
        path: '/similarUsers',
        name: 'similarUsers',
        component: SimilarUsers
    },
    {
        path: '/searchUsers',
        name: 'searchUser',
        component: SearchUsers
    },
    {
        path: '/showSearchUserList',
        name: 'showSearchUserList',
        component: ShowSearchUserList
    },
    {
        path: '/myTeam',
        name: 'myTeam',
        component: MyTeam
    },
    {
        path: '/teamJoined',
        name: 'teamJoined',
        component: TeamJoined
    },
    {
        path: '/createTeam',
        name: 'createTeam',
        component: CreateTeam
    },
    {
        path: '/joinTeam',
        name: 'joinTeam',
        component: JoinTeam
    }
];

const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes
});

export default router;